package cn.kxx.controller;

import cn.kxx.pojo.SysLog;
import cn.kxx.service.SysLogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @Auther: Kong Xiang Xiang
 * @Date: 2022/11/9 20:38
 * @DESC:
 */

@Controller
@RequestMapping("sysLog")
public class sysLogController {

    @Autowired
    private SysLogService sysLogService;

    @RequestMapping("findAll")
    public ModelAndView findAll(Integer page,Integer size){


        PageHelper.startPage(page,size);
        List<SysLog> list = sysLogService.findAll();

        PageInfo pageInfo = new PageInfo(list);

        ModelAndView mv = new ModelAndView();
        mv.setViewName("syslog-list");
        mv.addObject("pageInfo",pageInfo);
        return mv;


    }


}
